package com.learn.service.impl;

import com.learn.entities.Pay;
import com.learn.mapper.PayMapper;
import com.learn.service.PayService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author DJJ_F
 * @version 1.0
 * @date 2025/07/30
 * @description
 */
@Service
public class PayServiceImpl implements PayService {
    @Resource
    private PayMapper payMapper;
    @Override
    public int addPay(Pay pay) {
        return payMapper.insertSelective(pay);
    }

    @Override
    public int deletePayById(Integer id) {
        return payMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int updatePayById(Pay pay) {
        return payMapper.updateByPrimaryKeySelective(pay);
    }

    @Override
    public Pay selectOneById(Integer id) {
        return payMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<Pay> selectAll() {
        return payMapper.selectAll();
    }
}
